"""
test3 - 爬取图片并保存
"""
from lxml import etree
from utils import create_chrome_driver, download_pic, pull_down

headless = True
browser = create_chrome_driver(headless=headless)
browser.get('https://search.jd.com/Search?keyword=手机')
browser.maximize_window()

pull_down(browser, headless, sleep=0.5)
html = etree.HTML(browser.page_source)

pic_index = 1
page_count = 60

download_pic(html, '手机', pic_index, page_count)
browser.close()
